<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>鸡兔同笼问题</title>
</head>

<body>
    <script>
        //鸡兔同笼 一共50只 ，脚160 ，求鸡多少只 ，兔子多少只
        for (var i = 1; i <= 50; i++) {
            for (var j = 1; j <= 50; j++) {
                if (i + j == 50 && 4 * i + 2 * j == 160) {
                    console.log('鸡' + i + '兔子' + j);
                }
            }
        }


    </script>

</body>

</html>